package com.retail.order.entity.po;

import cn.hutool.crypto.digest.MD5;
import com.retail.core.entity.CommonEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;


/**
* 订单信息 PO
* @author Administrator
*/
@Data
public class RetailSettleOrderPo extends CommonEntity {
    @ApiModelProperty(value = "订单流水号")
    private java.lang.String shopNumber;
    @ApiModelProperty(value = "订单类型，21-团购，31-预售，41、90-外卖，51、70-次卡，60-券交易")
    private java.lang.Integer orderType;
    @ApiModelProperty("订单来源 0-抖音 1-美团")
    private Integer orderSource;
    @ApiModelProperty("订单编号")
    private String orderId;
    @ApiModelProperty(value = "订单状态")
    private java.lang.Integer orderStatus;
    @ApiModelProperty(value = "账户信息")
    private java.lang.String accountId;
    @ApiModelProperty(value = "账户名称")
    private java.lang.String accountName;
    @ApiModelProperty(value = "门店ID")
    private java.lang.String poiId;
    @ApiModelProperty(value = "门店名称")
    private java.lang.String poiName;
    @ApiModelProperty(value = "商品数量")
    private java.lang.Long num;
    @ApiModelProperty(value = "商品ID")
    private java.lang.String productId;
    @ApiModelProperty(value = "商品名称")
    private java.lang.String productName;
    @ApiModelProperty(value = "订单原始金额")
    private java.math.BigDecimal originalAmount;
    @ApiModelProperty(value = "订单实收金额(核心)pay_amount+payment_discount")
    private java.math.BigDecimal receiptAmount;
    @ApiModelProperty(value = "实收金额")
    private java.math.BigDecimal paymentDiscount;
    @ApiModelProperty(value = "订单金额")
    private java.math.BigDecimal payAmount;
    @ApiModelProperty(value = "订单时间")
    private String payTime;
    
    @ApiModelProperty("核销时间")
    private String verifyTime;

    public String orderHashMd5() {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(this.getOrderId());
        stringBuffer.append(this.getOrderType());
        stringBuffer.append(this.getOrderStatus());
        stringBuffer.append(this.getAccountId());
        stringBuffer.append(this.getPoiId());
        stringBuffer.append(this.getProductId());
        stringBuffer.append(this.getReceiptAmount().doubleValue());
        stringBuffer.append(this.getPayTime());
        stringBuffer.append(this.getOrderSource());
        return MD5.create().digestHex(stringBuffer.toString() + "");
    }
}
